package com.ckm.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.io.Serial;
import java.io.Serializable;
import java.sql.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Student implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    /**
     * id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 用户名
     */
    @ExcelProperty(value = "名称")
    @NotNull(message = "用户名不能为空")
    private String name;
    /**
     * 密码
     */
    @Size(min = 6,message = "密码最少为6位")
    private String password;
    /**
     * 班级id
     */
    @ExcelProperty(value = "班级")
    @NotNull(message = "班级不能为空")
    private Integer classId;
    /**
     * 年龄
     */
    @ExcelProperty(value = "年龄")
    @NotNull(message = "年龄不能为空")
    private Integer age;
    /**
     * 性别
     */
    @ExcelProperty(value = "性别")
    @NotNull(message = "性别不能为空")
    private Integer sex;
    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date createTime;
    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date updateTime;

}
